package com.china08.yxyapi.entity.mg.user;

import javax.persistence.Id;

import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import com.china08.yxyapi.entity.mg.MongoBaseEntityNoId;

/**
 * @author Richard.Wang
 *
 */
@SuppressWarnings("serial")
@Document(collection = "yxy.user.center")
public class YxyUserCenter extends MongoBaseEntityNoId {

    @Id
    private String id;

    /**
     * 用户id
     */
    @Indexed
    @Field(value = "user_id")
    private String userId;

    /**
     * 用户角色id
     */
    @Field(value = "user_role_id")
    private String userRoleId;

    /**
     * 最后访问资源选择的 学段，学科，版本
     */
    @Field(value = "last_res_view")
    private ResSubjectPhase lastResView;

    @Field(value = "last_weike_view")
    private ResSubjectPhase lastWeikeView;

    @Field(value = "last_weike_view_content")
    private ResSubjectPhase lastWeikeContentView;

    /**
     * 云课堂最后一次访问的目录
     */
    @Field(value = "last_cloud_lesson_view")
    private ResSubjectPhase lastCloudLessonView;

    /**
     * 云课堂最后一次访问的目录(知识点)
     */
    @Field(value = "last_cloud_lesson_know_view")
    private ResSubjectPhase lastCloudLessonKnowView;

    public class ResSubjectPhase {

        public String getSubjectId() {
            return subjectId;
        }

        public void setSubjectId(String subjectId) {
            this.subjectId = subjectId;
        }

        public String getPhaseId() {
            return phaseId;
        }

        public void setPhaseId(String phaseId) {
            this.phaseId = phaseId;
        }

        public String getSubjectName() {
            return subjectName;
        }

        public void setSubjectName(String subjectName) {
            this.subjectName = subjectName;
        }

        public String getPhaseName() {
            return phaseName;
        }

        public void setPhaseName(String phaseName) {
            this.phaseName = phaseName;
        }

        public String getVersionId() {
            return versionId;
        }

        public void setVersionId(String versionId) {
            this.versionId = versionId;
        }

        public String getVersionName() {
            return versionName;
        }

        public void setVersionName(String versionName) {
            this.versionName = versionName;
        }

        public String getBookId() {
            return bookId;
        }

        public void setBookId(String bookId) {
            this.bookId = bookId;
        }

        public String subjectId;
        public String subjectName;
        public String phaseId;
        public String phaseName;
        public String versionId;
        public String versionName;
        public String bookId;

        public String semester;
        public String semesterName;

        public String getSemester() {
            return semester;
        }

        public void setSemester(String semester) {
            this.semester = semester;
        }

        public String getSemesterName() {
            return semesterName;
        }

        public void setSemesterName(String semesterName) {
            this.semesterName = semesterName;
        }

    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public ResSubjectPhase getLastResView() {
        return lastResView;
    }

    public void setLastResView(ResSubjectPhase lastResView) {
        this.lastResView = lastResView;
    }

    public ResSubjectPhase getLastWeikeView() {
        return lastWeikeView;
    }

    public void setLastWeikeView(ResSubjectPhase lastWeikeView) {
        this.lastWeikeView = lastWeikeView;
    }

    /**
     * 给最后一次操作资源的view 赋值
     * 
     * @param phase
     * @param subject
     * @param version
     */
    public void setResView(String phase, String subject, String version, String subjectName, String phaseName,
            String versionName, String bookId, String semester, String semesterName) {
        ResSubjectPhase resSubjectPhase = new ResSubjectPhase();
        resSubjectPhase.setPhaseId(phase);
        resSubjectPhase.setPhaseName(phaseName);
        resSubjectPhase.setSubjectId(subject);
        resSubjectPhase.setSubjectName(subjectName);
        resSubjectPhase.setVersionId(version);
        resSubjectPhase.setVersionName(versionName);
        resSubjectPhase.setBookId(bookId);
        resSubjectPhase.setSemester(semester);
        resSubjectPhase.setSemesterName(semesterName);
        setLastResView(resSubjectPhase);
    }

    /**
     * 给最后一次操作微课的view 赋值
     * 
     * @param phase
     * @param subject
     */
    public void setWeikeView(String phase, String subject, String subjectName, String phaseName) {
        ResSubjectPhase resSubjectPhase = new ResSubjectPhase();
        resSubjectPhase.setPhaseId(phase);
        resSubjectPhase.setPhaseName(phaseName);
        resSubjectPhase.setSubjectId(subject);
        resSubjectPhase.setSubjectName(subjectName);
        setLastWeikeView(resSubjectPhase);
    }

    /**
     * 给最后一次微课按目录的view 赋值
     * 
     * @param phase
     * @param subject
     * @param version
     */
    public void setWeikeContentView(String phase, String subject, String version, String subjectName, String phaseName,
            String versionName, String bookId, String semester, String semesterName) {
        ResSubjectPhase resSubjectPhase = new ResSubjectPhase();
        resSubjectPhase.setPhaseId(phase);
        resSubjectPhase.setPhaseName(phaseName);
        resSubjectPhase.setSubjectId(subject);
        resSubjectPhase.setSubjectName(subjectName);
        resSubjectPhase.setVersionId(version);
        resSubjectPhase.setVersionName(versionName);
        resSubjectPhase.setBookId(bookId);
        resSubjectPhase.setSemester(semester);
        resSubjectPhase.setSemesterName(semesterName);
        setLastWeikeContentView(resSubjectPhase);
    }

    /**
     * 给最后一次云课堂添加课时目录赋值
     * 
     * @param phase
     * @param subject
     * @param version
     */
    public void setLastCloudLessonView(String phase, String subject, String version, String subjectName,
            String phaseName, String versionName, String bookId, String semester, String semesterName) {
        ResSubjectPhase resSubjectPhase = new ResSubjectPhase();
        resSubjectPhase.setPhaseId(phase);
        resSubjectPhase.setPhaseName(phaseName);
        resSubjectPhase.setSubjectId(subject);
        resSubjectPhase.setSubjectName(subjectName);
        resSubjectPhase.setVersionId(version);
        resSubjectPhase.setVersionName(versionName);
        resSubjectPhase.setBookId(bookId);
        resSubjectPhase.setSemester(semester);
        resSubjectPhase.setSemesterName(semesterName);
        setLastCloudLessonView(resSubjectPhase);
    }

    /**
     * 给最后一次云课堂添加课时目录赋值(知识点)
     * 
     * @param phase
     * @param subject
     * @param version
     */
    public void setLastCloudLessonKnowView(String phase, String subject, String subjectName, String phaseName) {
        ResSubjectPhase resSubjectPhase = new ResSubjectPhase();
        resSubjectPhase.setPhaseId(phase);
        resSubjectPhase.setPhaseName(phaseName);
        resSubjectPhase.setSubjectId(subject);
        resSubjectPhase.setSubjectName(subjectName);
        setLastCloudLessonKnowView(resSubjectPhase);
    }

    public String getUserRoleId() {
        return userRoleId;
    }

    public void setUserRoleId(String userRoleId) {
        this.userRoleId = userRoleId;
    }

    public ResSubjectPhase getLastWeikeContentView() {
        return lastWeikeContentView;
    }

    public void setLastWeikeContentView(ResSubjectPhase lastWeikeContentView) {
        this.lastWeikeContentView = lastWeikeContentView;
    }

    /**
     * @return the lastCloudLessonView
     */
    public ResSubjectPhase getLastCloudLessonView() {
        return lastCloudLessonView;
    }

    /**
     * @param lastCloudLessonView
     *            the lastCloudLessonView to set
     */
    public void setLastCloudLessonView(ResSubjectPhase lastCloudLessonView) {
        this.lastCloudLessonView = lastCloudLessonView;
    }

    public ResSubjectPhase getLastCloudLessonKnowView() {
        return lastCloudLessonKnowView;
    }

    public void setLastCloudLessonKnowView(ResSubjectPhase lastCloudLessonKnowView) {
        this.lastCloudLessonKnowView = lastCloudLessonKnowView;
    }

}
